package org.wzg.aityweb.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.wzg.aityweb.Service.ConsultService;
import reactor.core.publisher.Flux;

@RestController
@RequestMapping("/test")
public class AIChatController {

    @Autowired
    private ConsultService model;

    @RequestMapping(value = "/chat",produces = "text/html;charset=utf-8")
    public Flux<String> chat(String memoryId,String message) {
        Flux<String> consult = model.consult(memoryId,message);
        System.out.println(consult);
        return consult;
    }
/*
    @RequestMapping("/chat")
    public String chat(String question) {
        String chatted = model.consult(question);
        System.out.println(chatted);
        return chatted;
    }
*/

}
